package com.dong.applicationcontext.event;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.metrics.jfr.FlightRecorderApplicationStartup;

/**
 * description
 *
 * @author Administrator 2021/09/06 20:25
 */
public class EventTest {

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);

        FlightRecorderApplicationStartup applicationStartup = new FlightRecorderApplicationStartup();
        applicationStartup = (FlightRecorderApplicationStartup) context;

        MyApplicationEventPublisherAware publisherAware = context.getBean(MyApplicationEventPublisherAware.class);
        publisherAware.sendEmail("127.0.0.1","hello");
    }
}
